#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2017-2018, Intel Corporation
#
#
# pmempool_check/TEST22 -- test for checking pools with device dax under
#			valgrind
#

. ../unittest/unittest.sh

require_test_type medium

require_dax_devices 1
require_fs_type any

configure_valgrind memcheck force-enable $PMEMPOOL$EXESUFFIX
require_valgrind 3.11

setup

dax_device_zero

LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

HDR_MAJOR_OFFSET=8

POOLSET=$DEVICE_DAX_PATH

expect_normal_exit $PMEMPOOL$EXESUFFIX create blk 512 $POOLSET
expect_normal_exit $DDMAP$EXESUFFIX -o $POOLSET -s $HDR_MAJOR_OFFSET -d "0"

expect_normal_exit $PMEMPOOL$EXESUFFIX check -vry $POOLSET >> $LOG
expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOLSET &> /dev/null

check

pass
